package com.msb.test06;

public class Person {
    String name;
    int age;
    double weight;

    public static void study(){
        System.out.println("正在学习......");
    }
    //空构造器,自己写代码尽量要实现空构造器，当实现有参构造器时，系统不会分配默认构造器
    public Person(){
        Person.study();
        System.out.println("调用无参空构造器......");
    }

    //有参构造器
    public Person(String name, int age, double weight){
        Person.study();
        this.name = name;
        this.age = age;
        this.weight = weight;
        System.out.println("调用有参空构造器......");
    }

    public static void main(String[] args) {
        Person person = new Person("1",2,3);
        Person.study();
        System.out.println(person.age);
    }

}
